﻿using System;
using System.Collections.Generic;
using System.Text;
using AutoMapper;
using Microsoft.Extensions.DependencyInjection;
using FireBillBook.Core.Models;
using System.Threading.Tasks;
using FireBillBook.Core.Entities;
using CsvHelper;
using System.IO;

namespace FireBillBook.Core.Services
{
    public abstract class BasePlatformService : IPlatformService
    {
        public IMapper Mapper;
        public static PlatformServiceInfo ServiceInfo { get; set; }

        public virtual List<TDestination> Convert<TDestination, TSource>(List<TSource> originalDatas)
        {
            return Mapper.Map<List<TDestination>>(originalDatas);
        }

        public abstract Task<List<BillingSourceData>> ConvertOriginalDatas(CsvReader reader);
        public abstract Stream CleanData(Stream rawStream, Encoding defaultEncoding);
    }
}
